<template>
  <div id="addfriendlist"> 
          <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
          :row-class-name="tableRowClassName"  :border="true">
                
                 <el-table-column label="姓名"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.nickname }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="头像"  align='center'  width="150" >                   
                    <template slot-scope="scope">                   
                         <span v-if="scope.row.head_img">
                             <el-image 
                                style="width: 30px; height: 30px"
                                :src="urlimg + scope.row.head_img" 
                                :preview-src-list="scope.row.tx_picture" class="imga">
                            </el-image>
                        </span>
                        <span v-else>暂未上传</span>    
                    </template>
                </el-table-column>
                <el-table-column label="注册时间"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.register_time }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="好友总数"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.child_count }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="累积获得"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.ghy }}</span>
                    </template>
                </el-table-column>
                  <el-table-column label="操作" align='center'   fixed="right">
                    <template slot-scope="scope">
                        <el-button size="mini"  type="primary"  plain class="button_class1" @click="delect_but(scope.row)">删除</el-button> 
                    </template>
                </el-table-column>              
           </el-table>  
   </div>
</template>
<script>
export default {
   name: 'addfriendlist',
   props:{
      datalist:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 295
      
  },
  mounted (){
    
  },
  methods: {
  
  delect_but(row){
       
        this.$confirm('是否删除?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
             this.post("/marketer/delFriendLog", {
                    id:row.id,
                }).then(res => {
                    if(res.error_code == 0){
                      this.open1(res.result,'success')  //提示框
                     this.$emit('up_list_fun')
                     
                    }else {
                    this.open1(res.message,'warning')
                    }

              })
        })


    },

  }
}
</script>


<style scoped>
.imga>>>.el-icon-circle-close {
      color: white;
    }
</style>